1 # A rocket is started from the surface of the earth. Calculating the height as function of its mass and fuel consumption.
2 # Approximation of acceleration with Taylor series
4 # r'' = (alpha / m0)*v0 + (alpha/m0)²*v0*t - gamma * ME / r²
5 # alpha: fuel consumption, e.g. 2000t in 2,5 min = 13,333*10^3 kg/s
6 # m0: initial mass of rocket, e.g. Saturn V: 2900 t = 2,9*10^6 kg
7 # v0: the velocity of the exhaust of the rocket: 3,180*10^3 m/s
8 # gamma: gravitational constant: 6,6743E-11 m³/(kg*s²)
9 # ME: mass of earth: 5,97E+24 kg
12 include CompoundFunctions.LACE
14 coefficient.1(+1) -> alpha/m0*v0
15 coefficient.2(+1) -> (alpha/m0)^2*v0
16 coefficient.3 -> scale
17 coefficient.4(-1) -> -RE
18 coefficient.5(+1) -> 10*gamma*ME
23 # calculating altitude
24 iintegrate (alpha/m0*v0, (alpha/m0)^2*v0*t, -gamma*ME/r^2) -> -v # input is a ### 3. Term fehlen noch ###
25 cmultiply (scale, -v) -> -v.scaled
29 # calculating acceleration
31 idivide (10*gamma*ME, r^2) -> -10*gamma*ME/r^2
33 cmultiply ((alpha/m0)^2*v0, t) -> (alpha/m0)^2*v0*t
35 # inverting velocity for display
36 invert (-v.scaled) -> v.scaled
38 # subtracting the radius of earth in order to get altitude above ground for display